Skip to content

Adds SHOULD_NOT_CALL_PARENT - #455

Merged
SpaceManiac merged 4 commits into
SpaceManiac:masterfrom
Absolucy:shouldnt-nope-no
Jul 27, 2026
Merged

Adds SHOULD_NOT_CALL_PARENT#455
SpaceManiac merged 4 commits into
SpaceManiac:masterfrom
Absolucy:shouldnt-nope-no

Conversation

@Absolucy

Copy link
Copy Markdown
Contributor

Closes #407

This adds SHOULD_NOT_CALL_PARENT (SpacemanDMM_should_not_call_parent), which forbids procs from calling the direct parent.

/datum/proc/thing()
    SHOULD_NOT_CALL_PARENT(TRUE)
    CRASH("This should not be called!")

/datum/a/thing()
    // This will throw an error!
    return ..()

/datum/b/thing()
    // This is fine.
    return TRUE

/datum/b/c/thing()
    // This is ALSO fine, as it is a grandchild
    return ..()

/datum/c/d/thing()
    // This will throw also throw an error, as /datum/c does not implement thing()
    return ..()

@SpaceManiac
SpaceManiac merged commit 8451505 into SpaceManiac:master Jul 27, 2026
1 check passed
@Absolucy
Absolucy deleted the shouldnt-nope-no branch July 27, 2026 07:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature request: SHOULD_NOT_CALL_PARENT

2 participants